Skip to content

fix(desktop): invert window-drag regions so chrome stays clickable, add drag strips to uncovered screens - #5911

Merged
saddlepaddle merged 1 commit into
mainfrom
fix-topbar-cursor-navigat
Jul 24, 2026
Merged

saddlepaddle merged 1 commit into
mainfrom
fix-topbar-cursor-navigat

Conversation

@saddlepaddle

@saddlepaddle saddlepaddle commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Users could no longer click the topbar (pane tab bar) or right-sidebar chrome in v2 workspaces. Root cause: since #5824 the chrome bars are marked drag (Electron window-drag region) with no-drag carve-outs on interactive children — and Chromium loses those carve-outs when they sit inside masked/scrollable wrappers (OverflowFadeContainer) or CSS-zoomed wrappers (ZoomStable), turning the entire bar into a drag surface that swallows clicks.

This PR inverts the scheme everywhere: drag lives only on dedicated empty leaf elements (traffic-light spacers, flex fillers), never on containers with interactive children. Worst-case failure flips from "all controls dead" to "an empty sliver isn't draggable".

  • packages/panes TabBar: root no longer draggable; empty filler right of tabs carries drag. Also removed the zero-tab special-case branch so an empty bar renders identically to a populated one.
  • TopBar, DashboardSidebarHeader, settings header: same inversion (spacer + filler replace container drag + carve-outs), geometry-preserving.
  • PRActionHeader (v2 right sidebar): gained a drag filler — previously the sidebar had no drag surface at all.
  • Drag-less full-bleed screens now have top drag strips: v2 workspace state screens (not-found / creating / create-error / host-incompatible / missing-worktree / loading, via new StateScreenShell), auth-pending and offline screens, AuthProvider hydration splash, create-organization page.
  • TiptapPromptEditor: bare Cmd/Ctrl+Arrow (incl. Shift selection) always stays in the editor for line navigation; only Alt chords that resolve to a real hotkey bubble — app hotkeys fire in contenteditable and would otherwise preventDefault the cursor move.
  • AGENTS.md: documented the "drag on empty leaves only" rule.

Test Plan

  • v2 workspace with tabs: tabs, + button, run button, right-sidebar toggle all clickable; empty tab-bar area drags the window
  • Right sidebar: PR action header background drags the window; open-in/PR buttons clickable
  • Sidebar header strip and settings header: buttons clickable, empty areas drag — including at non-100% page zoom
  • Worktree-missing / workspace-not-found / creating screens: top strip drags the window
  • Launch splash and session-restoring screens: top strip drags the window
  • Chat input: ⌘←/→ moves cursor to line start/end, ⇧⌘←/→ selects, ⌘⌥←/→ still switches tabs

https://claude.ai/code/session_01FicLuUF7gtWzs1XGu9ePwM


Summary by cubic

Fixes dead clicks in the top bar and sidebar by moving Electron window-drag regions to empty, non-interactive elements. Also adds drag strips to state screens so the window stays draggable when the tab bar/top bar isn’t shown.

  • Bug Fixes
    • Moved drag to empty leaves across chrome: TopBar, DashboardSidebarHeader, settings header, and packages/panes TabBar (removed zero-tab special case). Controls remain clickable even inside masked/scrollable or zoomed wrappers.
    • Added missing drag surfaces: a drag filler in the v2 right sidebar PRActionHeader, plus top drag strips for v2 workspace state screens (not-found/creating/host-incompatible/missing-worktree/loading), auth-pending and offline screens, hydration splash, and create-organization.
    • TiptapPromptEditor: keep Cmd/Ctrl+Arrow (and Shift variants) inside the editor for line navigation; let Alt-resolved chords (e.g., Cmd+Opt+←/→) bubble to app hotkeys.
    • Documented the “drag on empty leaves only” rule in apps/desktop/AGENTS.md.

Written for commit 17b9f2b. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes

    • Improved window dragging across top bars, sidebars, settings, authentication, and workspace screens without interfering with interactive controls.
    • Preserved text selection for error messages and improved keyboard navigation with modifier keys.
    • Ensured tab bars maintain proper drag behavior, including when no tabs are present.
  • UI Improvements

    • Added consistent layout treatment for workspace loading, missing, creation, and error states.
    • Improved drag-region spacing on desktop and workspace headers.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Desktop window-drag regions are relocated to dedicated spacer elements, workspace fallback states gain a shared drag-aware shell, editor keyboard handling changes for Alt-modified chords, and renderer development guidance is expanded.

Changes

Desktop drag-region layout

Layer / File(s) Summary
Drag contract and desktop surfaces
apps/desktop/AGENTS.md, apps/desktop/src/renderer/..., apps/desktop/src/renderer/routes/create-organization/page.tsx
Drag regions are separated from interactive containers across authentication, settings, organization, dashboard, sidebar, and PR header layouts.
Tab-bar drag fillers
packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx
The tab bar always renders its main structure, with window dragging assigned to an internal empty filler element.

Workspace state-screen shell

Layer / File(s) Summary
Shared state-screen shell
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/StateScreenShell/*
Adds and re-exports StateScreenShell, which provides a full-size container and top drag strip.
Workspace state integration
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx
Wraps missing-worktree, missing-workspace, creation, host, and loading states with StateScreenShell.

Editor behavior and renderer guidance

Layer / File(s) Summary
Editor keyboard propagation
apps/desktop/src/renderer/components/Chat/ChatInterface/components/TiptapPromptEditor/TiptapPromptEditor.tsx
Updates Cmd/Ctrl+Arrow propagation handling for Alt-modified events and resolved hotkeys.
Renderer development guidance
apps/desktop/AGENTS.md
Documents selectable error text, observable tRPC subscriptions, and CDP renderer verification and authentication recovery.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the change and test plan, but it doesn't follow the required template sections and lacks a real 'How I tested it' and checklist. Rewrite it using the template headings: What & why, How I tested it, and Checklist; include actual verification steps and checkbox status.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: moving Electron drag regions to empty elements and adding drag strips to screens that lacked them.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-topbar-cursor-navigat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/AGENTS.md`:
- Around line 5-8: Expand the desktop AGENTS.md guidance to document the agent’s
responsibilities, capabilities, and interaction patterns, while preserving the
existing window-drag rule for empty leaf elements. Include actionable
expectations for how agents handle desktop UI interactions and avoid weakening
the current Chromium carve-out warning.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx`:
- Around line 75-79: Move V2WorkspaceTitle outside the div with the drag class
in the TopBar layout. Keep it as a normal sibling, and add a separate empty flex
filler element with the drag class beside it so drag applies only to a dedicated
empty leaf while preserving the existing spacing and alignment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d051b7b6-4399-4cc6-8073-e907f041bdf0

📥 Commits

Reviewing files that changed from the base of the PR and between f1bce64 and 17b9f2b.

📒 Files selected for processing (14)
  • apps/desktop/AGENTS.md
  • apps/desktop/src/renderer/components/Chat/ChatInterface/components/TiptapPromptEditor/TiptapPromptEditor.tsx
  • apps/desktop/src/renderer/providers/AuthProvider/AuthProvider.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarHeader/DashboardSidebarHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceSidebar/components/PRActionHeader/PRActionHeader.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/page.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/StateScreenShell/StateScreenShell.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/components/StateScreenShell/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/layout.tsx
  • apps/desktop/src/renderer/routes/create-organization/page.tsx
  • packages/panes/src/react/components/Workspace/components/TabBar/TabBar.tsx

Comment thread apps/desktop/AGENTS.md
Comment on lines +5 to +8
## Window-drag regions: `drag` on empty leaves only

Never mark a container with interactive children as `drag` and carve the children out with `no-drag`: Chromium loses the carve-outs when they sit inside masked, scrollable, or CSS-zoomed wrappers (OverflowFadeContainer, ZoomStable), which silently deadens every control under the bar. Instead, put `drag` only on dedicated empty leaf elements — traffic-light spacers and flex fillers (see TopBar, DashboardSidebarHeader, packages/panes TabBar). The worst failure mode then is "empty area not draggable" instead of "chrome swallows clicks".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Document agent responsibilities and capabilities.

This adds interaction guidance, but does not identify agent responsibilities or capabilities as required for desktop AGENTS.md. As per coding guidelines, apps/desktop/**/AGENTS.md must “Document agent responsibilities, capabilities, and interaction patterns in AGENTS.md”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/desktop/AGENTS.md` around lines 5 - 8, Expand the desktop AGENTS.md
guidance to document the agent’s responsibilities, capabilities, and interaction
patterns, while preserving the existing window-drag rule for empty leaf
elements. Include actionable expectations for how agents handle desktop UI
interactions and avoid weakening the current Chromium carve-out warning.

Source: Coding guidelines

Comment on lines +75 to 79
<div className="drag flex h-full min-w-0 flex-1 items-center justify-start">
{isV2WorkspaceRoute && v2WorkspaceId && (
<V2WorkspaceTitle workspaceId={v2WorkspaceId} />
)}
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the v2 title outside the drag region.

V2WorkspaceTitle is rendered inside the drag element, so this is not an empty leaf. Make the title a normal sibling and place a separate empty flex filler beside it.

Proposed fix
-			<div className="drag flex h-full min-w-0 flex-1 items-center justify-start">
+			<div className="flex h-full min-w-0 flex-1 items-center justify-start">
 				{isV2WorkspaceRoute && v2WorkspaceId && (
 					<V2WorkspaceTitle workspaceId={v2WorkspaceId} />
 				)}
+				<div className="drag h-full min-w-0 flex-1" />
 			</div>

As per coding guidelines, apply drag only to dedicated empty leaf elements.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="drag flex h-full min-w-0 flex-1 items-center justify-start">
{isV2WorkspaceRoute && v2WorkspaceId && (
<V2WorkspaceTitle workspaceId={v2WorkspaceId} />
)}
</div>
<div className="flex h-full min-w-0 flex-1 items-center justify-start">
{isV2WorkspaceRoute && v2WorkspaceId && (
<V2WorkspaceTitle workspaceId={v2WorkspaceId} />
)}
<div className="drag h-full min-w-0 flex-1" />
</div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx`
around lines 75 - 79, Move V2WorkspaceTitle outside the div with the drag class
in the TopBar layout. Keep it as a normal sibling, and add a separate empty flex
filler element with the drag class beside it so drag applies only to a dedicated
empty leaf while preserving the existing spacing and alignment.

Source: Coding guidelines

@saddlepaddle
saddlepaddle merged commit ae7779d into main Jul 24, 2026
18 checks passed

This branch was previously deployed

1 inactive deployment
preview — 17b9f2b5 Deployed Jul 24, 2026 by saddlepaddle via Deploy Admin #6812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant